package spring.pojo.HelloWorld.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import spring.pojo.HelloWorld.service.UserService;

/**
 * @author Yancy xiao
 * @create 2022-11-18 17:18
 */
@Controller
public class UserController {
    @Autowired
    private UserService userService;

    public void saveUser() {
        userService.saveUser();
    }

    /* 依赖注入和基于xml管理bean需要set方法，利用set方法/构造器完成注入*/
    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}